<?php


namespace common\validate;

class CheckList extends BaseValidate
{
    public $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // Find 验证场景定义
    public function sceneFind()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'array');
    }

    // Select 验证场景定义
    public function sceneSelect()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'array')
            ->append('param.page', 'array');
    }

    // Create 验证场景定义
    public function sceneCreate()
    {
        return $this->append("data", "require|array")
            ->append("data.step_id", "require|integer")
            ->append("data.percentage", "require|integer")
            ->append("data.content", "require");
    }

    // Update 验证场景定义
    public function sceneUpdate()
    {
        return $this->append("data", "require|array")
            ->append("data.step_id", "require|integer")
            ->append("data.percentage", "require|integer")
            ->append("data.content", "require");
    }

    // Delete 验证场景定义
    public function sceneDelete()
    {
        $this->append("param", 'require')
            ->append("param.filter", "require");
    }
}
